package com.pand.util;

/**
 * Created by lh on 2017/11/3.
 */
public class Response {
    private String state;

    private Object data;

    public Response() {
    }

    public Response(String state) {
        this.state = state;
    }

    public static final Response ok() {
        return new BaseResponse("success");
    }

    public static final Response fail() {
        return new BaseResponse("failure");
    }

    public Response data(Object data) {
        this.data = data;
        return this;
    }

    public String getstate() {
        return state;
    }

    public void setstate(String state) {
        this.state = state;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    private static class BaseResponse extends Response {
        public BaseResponse(String state) {
            super(state);
        }
    }
}